package com.learn;

class ThreadDemo02 implements Runnable{
    public void run() {
        System.out.println("子线程启动");
        for (int i = 0; i < 10; i++) {
            System.out.println("i:"+i);
        }
        System.out.println("子线程结束");
    }
}
/**
 *   1,runable 接口
 */
public class Thread002 {


    public static void main(String[] args){
        System.out.println("主线程启动");
        ThreadDemo02 threadDemo02=new ThreadDemo02();
        new Thread(threadDemo02).start();
        System.out.println("主线程结束");
    }
}
